<template>
  <div class="home">
    <!-- <img alt="Vue logo" src="../assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js App"/> -->
    Welcome to my web Page ! !
                      <button @click.once="sign()">{{msg}}</button>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'

export default {
  name: 'HomeView',
  data(){
    return{
      msg:'签到'
    }
  },
  components: {
    HelloWorld
  },
  mounted(){
    this.msg = sessionStorage.getItem('sign')? '已签到':'签到'
  },
  methods:{
    sign(){
      this.msg = "已签到"
      sessionStorage.setItem('sign',true)
    }
  }
}
</script>
